<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
        <canvas width="600" height="400"></canvas>
        <script>
            var myCanvas = document.querySelector("canvas");
            var ctx = myCanvas.getContext("2d");

            // 绘制弧度

            var w = ctx.canvas.width;
            var h = ctx.canvas.height;

            // arc(圆心x,圆心y,半径长度,开始位置,结束位置,方向/默认顺时针) 圆心向右位置为0
            ctx.arc(w/2,h/2,150,Math.PI / 2,Math.PI,true);
            ctx.stroke();
    
        </script>
    
</body>
</html>